<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="org.swimv2.entities.*" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<% 
// L'utente loggato
User curr_u = (User) request.getSession().getAttribute("user");
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
@import url(/WEBswim2/css/main.css);
</style>
<title>Login</title>
</head>
<body>

<p class="homenav"><a href="/WEBswim2/home.jsp"><span>Home</span></a></p>

<h1>Login</h1>
<%
	String msg = (String) request.getAttribute("error_message");
	if(msg != null) {
		out.println("<p class=\"error_message\">" + msg + "</p>");
	}
%>

<% if (curr_u == null) { %>
<form action="/WEBswim2/Login" method="post">
  <fieldset>
	<label for="email">Email:</label><br/>
	<input type="text" name="email"/><br/>
	<label for="password">Password:</label><br/>
	<input type="password" name="password"/><br/>
	<input type="submit" name="submit" value="Login"/>
  </fieldset>
</form>
<% } %>
</body>
</html>